<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"></script>
</head>

<body>
  <div id="app">
    <!-- v-for循环遍历一个数组, 没有使用索引值(下标值) -->
    <ul>
      <li v-for="item in names">{{item}}</li>
    </ul>

    <!-- v-for循环遍历一个数组, 使用索引值(下标值) -->
    <ul>
      <li v-for="(item,index) in names">{{index}} {{item}}</li>
    </ul>
  </div>
  <script>
    const app = new Vue({
      el: "#app",
      data: {
        names: ["xiaoLam", "kobe", "jams", "copo"]
      }
    })
  </script>
</body>

</html>